import streamlit as st
import random  # 添加缺失的导入语句

st.title("Hello Streamlit!")
name = st.text_input("请输入你的名字")
st.write(f"你好，{name}！")

if st.button("生成随机数"):
    st.write("随机数:", random.random())
